cmake_minimum_required(VERSION 3.0.2)
project(drone_ground_station)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
  message_generation
  geometry_msgs
  nav_msgs
  sensor_msgs
  std_msgs
  std_srvs
  roscpp
  rospy
  tf
  tf2_ros
  tf2_eigen
  uav_drone_msgs
)

## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)


################################################
## Declare ROS messages, services and actions ##
################################################
add_message_files(
  FILES
  Person_ground.msg
)
## Generate added messages and services with any dependencies listed here
generate_messages(
   DEPENDENCIES
   geometry_msgs
   nav_msgs
   sensor_msgs
   std_msgs
)


###################################
## catkin specific configuration ##
###################################
catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
)

###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
   include
  ${catkin_INCLUDE_DIRS}
  ../common/include
)

###############################
##      声明可执行cpp文件     ##
###############################

###### Main File ##########
##ground_station_msg.cpp
add_executable(ground_station_msg src/ground_station_msg.cpp)
add_dependencies(ground_station_msg drone_ground_station_gencpp)
target_link_libraries(ground_station_msg ${catkin_LIBRARIES})

add_executable(ground_station src/ground_station.cpp)
add_dependencies(ground_station drone_ground_station_gencpp)
target_link_libraries(ground_station ${catkin_LIBRARIES})

#############
## Install ##
#############


## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
   FILES_MATCHING PATTERN "*.h"
)

install(DIRECTORY launch/
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_drone_ground_station.cpp)
# if(TARGET ${PROJECT_NAME}-test)
#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
